<extend name="Base/base" />
<block name="button">	
	<button class="btn btn-primary" type="submit" form="form"><i class="fa fa-save"></i> {:L('text_save')}</button>
</block>
<block name="body">
	<if condition="$msg">
		<div class="alert alert-danger alert-dismissible fade in" role="alert">
		      <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
		      {$msg.warning}

		    </div>
	</if>
	<div class="panel panel-default">
		<div class="panel-heading">
			<h4><i class="fa fa-pencil fa-fw"></i>  {$heading_title}</h4>
		</div>
		<div class="panel-body">
			<form action="" method="post" id="form" class="form-horizontal">
				<ul class="nav nav-tabs">
					<li class="active">
						<a href="#tab-general" data-toggle="tab">{:L('text_general')}</a>
					</li>
					<li>
						<a href="#tab-advanced" data-toggle="tab">{:L('text_advanced')}</a>
					</li>
				</ul>
				<div class="tab-content">
					<div class="tab-pane active" id="tab-general">
						<ul class="nav nav-tabs">
							<foreach name="languages" key="key" item="language">
								<li <?php if(!$key) echo 'class="active"'; ?>>
									<a href="#language{$language.language_id}" data-toggle="tab"><img src="__PUBLIC__/Images/flags/{$language.image}">  {$language.name}</a>
								</li>
							</foreach>
						</ul>
						<div class="tab-content">
							<foreach name="languages" key="key" item="language">
								<div class="tab-pane <?php if(!$key) echo 'active'; ?>" id="language{$language.language_id}">
									<div class="form-group required">
										<label for="input-title{$language.language_id}" class="col-sm-2 control-label">{:L('entry_title')}</label>
										<div class="col-sm-10">
											<input type="text" name="category_description[{$language.language_id}][title]" value="{$category['category_description'][$language['language_id']]['title']|default=''}" placeholder="{:L('entry_title')}" id="iput-title{$language.language_id}" class="form-control">
											<if condition="isset($msg['title'][$language['language_id']])">
											{:danger_msg($msg['title'][$language['language_id']])}
											</if>
										</div>
									</div>
									<div class="form-group">
										<label for="input-description{$language.language_id}" class="col-sm-2 control-label">{:L('entry_description')}</label>
										<div class="col-sm-10">
											<textarea name="category_description[{$language.language_id}][description]" id="input-description{$language.language_id}" class="form-control summernote" placeholder="{:L('entry_description')}">{$category['category_description'][$language['language_id']]['description']|default=""}</textarea>
										</div>
									</div>
									<div class="form-group">
										<label for="input-meta-title{$language.language_id}" class="col-sm-2 control-label">{:L('entry_meta_title')}</label>
										<div class="col-sm-10">
											<input type="text" name="category_description[{$language.language_id}][meta_title]" value="{$category['category_description'][$language['language_id']]['meta_title']|default=''}" placeholder="{:L('entry_meta_title')}" id="iput-meta-title{$language.language_id}" class="form-control">
											<if condition="isset($msg['meta_title'][$language['language_id']])">
											{:danger_msg($msg['meta_title'][$language['language_id']])}
											</if>
										</div>
									</div>
									<div class="form-group">
										<label for="input-meta-description{$language.language_id}" class="col-sm-2 control-label">{:L('entry_meta_description')}</label>
										<div class="col-sm-10">
											<textarea rows="5"  name="category_description[{$language.language_id}][meta_description]"  placeholder="{:L('entry_meta_description')}" id="input-meta-description{$language.language_id}" class="form-control">{$category['category_description'][$language['language_id']]['meta_description']|default=''}</textarea>
											<if condition="isset($msg['meta_description'][$language['language_id']])">
											{:danger_msg($msg['meta_description'][$language['language_id']])}
											</if>
										</div>
									</div>
									<div class="form-group">
										<label for="input-meta-keyword{$language.language_id}" class="col-sm-2 control-label">{:L('entry_meta_keyword')}</label>
										<div class="col-sm-10">
											<textarea rows="5"  name="category_description[{$language.language_id}][meta_keyword]"  placeholder="{:L('entry_meta_keyword')}" id="input-meta-description{$language.language_id}" class="form-control">{$category['category_description'][$language['language_id']]['meta_keyword']|default=""}</textarea>
											<if condition="isset($msg['meta_keyword'][$language['language_id']])">
											{:danger_msg($msg['meta_keyword'][$language['language_id']])}
											</if>
										</div>
									</div>
								</div>
							</foreach>
						</div>
					</div>
					<div class="tab-pane" id="tab-advanced">
						<div class="form-group">
							<label for="input-image" class="control-label col-sm-2">{:L('entry_image')}</label>
							<div class="col-sm-10">
								<a href="" id="thumb-image" data-toggle="image" class="img-thumbnail"><img src="{$category['thumb']|default=''}" alt="" title="" data-placeholder="{$category['placeholder']|default=''}" /></a>
                  				<input type="hidden" name="image" value="{$category['image']|default=''}" id="input-image" />
							</div>
						</div>
						<div class="form-group">
							<label for="input-parent" class="col-sm-2 control-label">{:L('entry_parent')}</label>
							<div class="col-sm-10">
								<select name="parent_id" id="input-parent" class="form-control">
									<option value="0">{:L('text_root')}</option>
									<foreach name="categories" item="item">
										<option value="{$item.category_id}" <if condition="isset($category['parent_id']) && $item['category_id'] eq $category['parent_id']">selected</if>>{$item.html}{$item.title}</option>
									</foreach>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="input-page" class="col-sm-2 control-label">{:L('entry_page')}
								<span data-toggle="tooltip" data-original-title="{:L('help_page')}" class="text-primary"><i class="fa fa-question-circle"></i></span>
							</label>
							<div class="col-sm-10">
								<input name="page" id="input-page" type="number" class="form-control" placeholder="{:L('entry_page')}" value="{$category.page|default=''}">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">{:L('entry_image_size')}
								<span data-toggle="tooltip" data-original-title="{:L('help_image_size')}" class="text-primary"><i class="fa fa-question-circle"></i></span>
							</label>
							<div class="col-sm-5">
								<input name="width" id="input-width" type="number" class="form-control" placeholder="{:L('entry_width')}" value="{$category.width|default=''}">
							</div>
							<div class="col-sm-5">
								<input name="height" id="input-height" type="number" class="form-control" placeholder="{:L('entry_height')}" value="{$category.height|default=''}">
							</div>
						</div>
						<div class="form-group">
							<label for="input-sort-order" class="col-sm-2 control-label">{:L('entry_sort_order')}</label>
							<div class="col-sm-10">
								<input type="number" class="form-control" value="{$category['sort_order']|default=''}"  id="input-sort-order" name="sort_order" placeholder="{:L('entry_sort_order')}">
							</div>					
						</div>
						<div class="form-group">
							<label for="input-list-tpl" class="col-sm-2 control-label">{:L('entry_list_tpl')}</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" value="{$category['list_tpl']|default=''}"  id="input-list-tpl" name="list_tpl" placeholder="{:L('entry_list_tpl')}">
							</div>					
						</div>
						<div class="form-group">
							<label for="input-detail-tpl" class="col-sm-2 control-label">{:L('entry_detail_tpl')}</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" value="{$category['detail_tpl']|default=''}"  id="input-detail-tpl" name="detail_tpl" placeholder="{:L('entry_detail_tpl')}">
							</div>					
						</div>
						<div class="form-group">
							<label for="input-status" class="control-label col-sm-2">{:L('text_status')}</label>
							<div class="col-sm-10">
								<select name="status" id="input-status" class="form-control">
									<option value="1">{:L('text_enabled')}</option>
									<option <if condition="isset($category['status']) && ($category['status'] eq 0)">selected</if> value="0">{:L('text_disabled')}</option>
								</select>
							</div>
						</div>	
					</div>
				</div>
			</form>
		</div>		
	</div>
</block>